#!/usr/bin/env bash

source /etc/profile

HOME_DIR=`pwd`
INFRAME_DIR=`dirname ${HOME_DIR}`
WORKSPACE_DIR=`dirname ${INFRAME_DIR}`

# 打印
function println(){
    echo -e "[--INFRAME--]:${1}"
}

println ${HOME_DIR}
println ${INFRAME_DIR}
println ${WORKSPACE_DIR}

# 穿件目录
# @param path 目录路径
function buildir(){
    # 检查父目录
    parentdir=`dirname $1`
    if [ ! -d ${parentdir} ]; then
        println "make parent-directory ${parentdir}";
        buildir ${parentdir};
    fi
    # 创建文件夹
    if [ ! -d $1 ]; then
        if [ '' == `mkdir $1` ]; then
            println "make directory ${1}:success";
        else
            println "make directory ${1}:failed";
        fi
    else
        println "make directory ${1}:exist and skip";
    fi
}



